<!DOCTYPE html>
<html>
<head>
    <title></title>
    <#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <!--提现订单列表-->
    <div v-show="showList">
          <div class="grid-btn">
              <el-form :inline="true" size="mini">
                  <el-form-item label="申请id">
                      <el-input v-model="q.id" placeholder="分类"></el-input>
                  </el-form-item>
                  <el-form-item label="联动单号">
                      <el-input v-model="q.payNo" placeholder="联动单号"></el-input>
                  </el-form-item>
                  <el-form-item label="商户">
                      <el-select
                              v-model="q.sellerId"
                              filterable
                              clearable
                              remote
                              reserve-keyword
                              placeholder="请输入商户名称"
                              :remote-method="remoteMethod"
                              :loading="loading">
                          <el-option
                                  v-for="item in sellerList"
                                  :key="item.sellerId"
                                  :label="item.sellerName"
                                  :value="item.sellerId">
                          </el-option>
                      </el-select>
                  </el-form-item>
                  <el-form-item label="提现状态">
                      <el-select v-model="q.applyStatus" clearable placeholder="请选择">
                          <el-option
                                  v-for="item in applyStatusList"
                                  :key="item.value"
                                  :label="item.label"
                                  :value="item.value">
                          </el-option>
                      </el-select>
                  </el-form-item>
                  <el-form-item>
                      <el-button icon="el-icon-search" @click="query" circle></el-button>
                  </el-form-item>
              </el-form>
          </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <!--提现订单明细-->
    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">操作</div>
        <div style="padding: 10px;padding-left: 20px; text-align:center">
            <button type="button" style="width: 100px;"  @click="check" class="btn  btn-primary btn-sm"><i class="fa fa-check"></i>&nbsp;审核</button>
            <button type="button" style="margin-left: 30px; width: 100px"  @click="reject" class="btn  btn-danger btn-sm"><i class="fa fa-times"></i>&nbsp;驳回</button>
            <button type="button" v-if="merchantApplyCash.applyStatus >0"   style="margin-left: 30px; width: 100px;"  @click="search" class="btn  btn-primary btn-sm"><i class="fa fa-search"></i>&nbsp;实时查看</button>
            <button type="button" style="margin-left: 30px;width: 100px"  @click="goBack" class="btn  btn-default btn-sm"><i class="fa fa-arrow-left"></i>&nbsp;返回</button>
        </div>
        <div class="panel-heading">单据信息</div>
        <div class="form-horizontal" style="width: auto;">
            <div class="row">
                <div class="col-md-4">
                    <div class="form-group">
                        <div class="col-sm-2 control-label">单据编号</div>
                        <div class="col-sm-6">
                            <input type="text" readonly class="form-control" v-model="merchantApplyCash.id" />
                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <div class="col-sm-2 control-label">供应商</div>
                        <div class="col-sm-6">
                            <input type="text" readonly class="form-control" v-model="merchantApplyCash.merchantName" p/>
                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <div class="col-sm-2 control-label">单据状态</div>
                        <div class="col-sm-6">
                            <input type="text" readonly class="form-control" v-model="merchantApplyCash.applyStatusText" />
                        </div>
                    </div>
                </div>

            </div>

            <div class="row">
                <div class="col-md-4">
                    <div class="form-group">
                        <div class="col-sm-2 control-label">申请金额</div>
                        <div class="col-sm-6">
                            <input type="text" readonly class="form-control" v-model="merchantApplyCash.applyMoney" />
                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <div class="col-sm-2 control-label">汇费</div>
                        <div class="col-sm-6">
                            <input type="text" readonly class="form-control" v-model="merchantApplyCash.applyFee" />
                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <div class="col-sm-2 control-label">申请人</div>
                        <div class="col-sm-6">
                            <input type="text" readonly class="form-control" v-model="merchantApplyCash.applyUserName" />
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-md-4">
                    <div class="form-group">
                        <div class="col-sm-2 control-label">提交时间</div>
                        <div class="col-sm-6">
                            <input type="text" readonly class="form-control" v-model="merchantApplyCash.applyTime" />
                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <div class="col-sm-2 control-label">审核人</div>
                        <div class="col-sm-6">
                            <input type="text" readonly class="form-control" v-model="merchantApplyCash.auditorName" />
                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <div class="col-sm-2 control-label">审核时间</div>
                        <div class="col-sm-6">
                            <input type="text" readonly class="form-control" v-model="merchantApplyCash.auditTime"/>
                        </div>
                    </div>
                </div>
            </div>


            <div class="row">
                <div class="col-md-4">
                    <div class="form-group">
                        <div class="col-sm-2 control-label">备注</div>
                        <div class="col-sm-10">
                            <input type="text" readonly class="form-control" v-model="merchantApplyCash.remark" />
                        </div>
                    </div>
                </div>
                <div class="col-md-4"></div>
                <div class="col-md-4"></div>
            </div>


        </div>
        <div class="panel-heading">单据详情</div>
        <table id="jqOrderItemsGrid"></table>
        <div class="panel-heading">原始单据详情</div>
        <table id="jqOldOrderItemsGrid"></table>
        <div class="panel-heading">操作日志</div>
        <table id="jqApplyCashLogGrid"></table>

        <el-dialog
                size="mini"
                center
                title="订单查询结果"
                :visible.sync="searchResultVisible"
                width="500px"
                >
            <el-form label-width="80px" size="small">
                <el-form-item label="申请单号:" >
                    <el-input v-model="merchantApplyCash.id" readonly></el-input>
                </el-form-item>
                <el-form-item label="联动单号:" >
                    <el-input v-model="merchantApplyCash.applyPayId" readonly></el-input>
                </el-form-item>
                <el-form-item label="状态码:" >
                    <el-input v-model="searchResult.code" readonly></el-input>
                </el-form-item>
                <el-form-item label="状态:" >
                    <el-input v-model="searchResult.message" readonly></el-input>
                </el-form-item>
            </el-form>
            <span slot="footer" class="dialog-footer">
               <!--重置状态需要 满足当前订单状态为失败4 同时查询订单状态也为失败1552-->
            <el-button size="mini" v-if="merchantApplyCash.applyStatus === 4 && searchResult.code === 1552" @click="resetApplyStatus" type="danger" >重置审核状态</el-button>
                <!--确认打款需要 满足当前订单状态为1 审核通过 同时查询订单状态为成功1554-->
            <el-button size="mini" v-if="merchantApplyCash.applyStatus === 1 && searchResult.code === 1554" @click="confirmCash" type="warning" >确认已打款</el-button>
            <el-button size="mini" @click="searchResultVisible = false">取 消</el-button>
          </span>
        </el-dialog>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/capital/applyCashSmallBCheck.js?_${.now?long}"></script>
</body>
</html>